<template>
  <div class="prcinformation">
    <div class="flex Box1">
      <div>
        <span>定价方式：</span><span class="spancolor">{{ PricingData.roi }} %</span><span>(按份)</span>
      </div>
      <div>
        <span>定价权限：</span><span class="spancolor">{{ PricingData.pricingAuthorityType == 1 ? '自定义' : '中心定价' }}</span>
      </div>
    </div>
    <div class="flex">
      <div>
        <span>耗材成本：</span><span class="spancolor">{{ PricingData.conosumablesCost ? PricingData.conosumablesCost : 0
          }}元</span>
      </div>
      <div>
        <span>预估成本：</span><span>{{ PricingData.cost ? PricingData.cost : 0 }}</span><span>{{ PricingData.pricingType ==
          'pricingType' ? '元/kg'
          : '元/份' }}</span>
      </div>
    </div>
    <div class="flex Box2">
      <div>
        <span>实际售价：</span><span class="spancolor">{{ PricingData.sellPrice ? PricingData.sellPrice : 0 }}</span><span>{{
          PricingData.pricingType ==
            'pricingType' ? '/kg' : '/份' }}</span>
      </div>
      <div>
        <span>预估售价：</span><span class="spancolor">{{ PricingData.estimatedSellPrice ? PricingData.estimatedSellPrice : 0
          }}</span><span>{{
            PricingData.pricingType == 'pricingType' ? '/kg' : '/份' }}</span>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { GetDishPricingApi } from '@/api/Dashmana'
const props = defineProps({
  Bomdata: {
    type: Object,
    default: {}
  }
})
const PricingData = ref({} as any)
onMounted(() => {
  GetDishPricingApi({
    "dishCode": props.Bomdata.dishCode
  }).then((res) => {
    PricingData.value = res.data
  })
})
</script>

<style lang="scss" scoped>
.prcinformation {
  font-family: PingFang SC, PingFang SC;
  font-weight: 400;
  font-size: 16px;
  color: rgba(0, 0, 0, 0.65);
  font-style: normal;
  text-transform: none;

  .Box1 {
    margin: 40px 0;
  }

  .Box2 {
    margin-top: 40px;
  }

  .spancolor {
    font-family: PingFang SC, PingFang SC;
    font-weight: 600;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.85);
    text-align: left;
    font-style: normal;
    text-transform: none;
  }

  >div>div {
    width: 250px;
  }
}
</style>
